package com.bw.video

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import androidx.databinding.DataBindingUtil
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.bw.base.constants.RoutePath
import com.bw.video.databinding.ActivitySplashBinding


@Route(path = RoutePath.PATH_SPLASH)
class SplashActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        val binding =
            DataBindingUtil.setContentView<ActivitySplashBinding>(this, R.layout.activity_splash)
        setContentView(binding.root)


        binding.tv.setOnClickListener {
            ARouter.getInstance().build(RoutePath.PATH_MAIN).navigation()
        }


//        Log.i("--s", "onCreate: ${permuteSwap(3, 3)}")
//        Log.i("--s", "onCreate: ${permuteSwap(4, 9)}")
//        Log.i("--s", "onCreate: ${permuteSwap(3, 1)}")

    }


    fun getStr(n: Int, k: Int): String {
        val intArray = IntArray(n) { it + 1 }

        intArray.forEach { i ->
            intArray.forEach { j ->

            }

        }


        return ""
    }


//    fun permuteSwap(n: Int, k: Int): String {
//        val result = mutableListOf<String>()
//        generate(n, IntArray(n) { it + 1 }, result, 0)
//        val index = k -1
//        var str = ""
//        if (index >= result.size || index < 0) {
//            str = "下标越界"
//        } else {
//            str = result[index]
//        }
//        return str
//    }
//
//    private fun generate(
//        n: Int,
//        arr:IntArray,
//        result: MutableList<String>,
//        start: Int
//    ) {
//        if (start == n) {
//            result.add(arr.joinToString("")) // 转换为字符串[3](@ref)
//            return
//        }
//
//        for (i in start until n) {
//            swap(arr, start, i)
//            generate(n, arr, result, start + 1)
//            swap(arr, start, i)
//        }
//    }
//
//    private fun swap(arr: IntArray, i: Int, j: Int) {
//        val temp = arr[i]
//        arr[i] = arr[j]
//        arr[j] = temp
//    }


}